﻿using DocumentFormat.OpenXml.Presentation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Animation;

namespace PPTHelper.BLL.TimingRoot
{
    public class SetBehaviorContainer : ActionContainer
    {
        /// <summary>
        /// 这个属性指定动画效果后时间节点的特定属性。
        /// </summary>
        public ToVariantValue ToVariantValue { get; set; }

        /// <summary>
        /// 运行一个动画
        /// </summary>
        public override void Run(TriggerInfo triggerInfo)
        {
            Console.WriteLine("执行Set容器。");

            //ShapeInfo shpaeInfo = Shapes.Where(i => i.SpId == int.Parse(CommonTimeNode.Id)).FirstOrDefault();

            //// 如果找不到shape，直接返回
            //if (shpaeInfo == null)
            //    return;

            //ObjectAnimationUsingKeyFrames animate = new ObjectAnimationUsingKeyFrames();

            //Storyboard storyboard = new Storyboard();
            ////Storyboard.SetTargetName(animate, "button");

            //Storyboard.SetTargetProperty(storyboard, new PropertyPath("Visibility"));

            //Storyboard.SetTarget(animate, shpaeInfo.Path);

            //DiscreteObjectKeyFrame discrete = new DiscreteObjectKeyFrame();
            //discrete.KeyTime = TimeSpan.FromMilliseconds(int.Parse(CommonTimeNode.Duration));
            //discrete.Value = Visibility.Visible;

            //var a = CommonTimeNode.Fill;


            //animate.KeyFrames.Add(discrete);

            //storyboard.Children.Add(animate);
            //storyboard.Begin();

        }
    }
}
